package com.foreknow.demo6;

public class Test {
    public void m1(A a){ // AImpl()
        a.eat();
    }

    public A m2(){
        A a = new AImpl();
        return a;
    }

    public static void main(String[] args) {
        Test test = new Test();
        A a = new AImpl();
        test.m1(a);
        A a1 = test.m2();
        a1.eat();
    }
}
